import mongoose from 'mongoose';

const clothesSchema = new mongoose.Schema({
  name: {
    type: String,
    trim: true,
    default: ''
  },
  type: {
    type: [],
    required: true,
    trim: true
  },
  color: {
    type: String,
    trim: true,
    default: ''
  },
  season: {
    type: [String],
    default: []
  },
  occasions: {
    type: [String],
    default: []
  },
  purchaseDate: {
    type: String
  },
  price: {
    type: Number,
    default: null
  },
  brand: {
    type: String,
    trim: true
  },
  material: {
    type: String,
    trim: true
  },
  size: {
    type: String,
    trim: true
  },
  isFavorite: {
    type: Boolean,
    default: false
  },
  lastWorn: {
    type: Date
  },
  wearCount: {
    type: Number,
    default: 0
  },
  imageUrls: {
    type: [String],
    default: []
  },
  description: {
    type: String,
    trim: true
  },
  userId: {
    type: mongoose.Schema.Types.ObjectId,
    ref: 'User',
    required: true
  }

}, {
  timestamps: true
});

const Clothes = mongoose.model('Clothes', clothesSchema);

export default Clothes;